/*
 *调用方法：
 *confirmTip(str, callback)
 *str传入提示语  callback回调
 */

function confirmTip(tip, callback){
	var tip = tip || '确定要退出文件系统吗？'
	
	var style = '';
	var shtml = '';
	style += '<style>';
	style += '	.mask{position:fixed;top:0;left:0;width:100%;height:100%;background:url(../views/img/mask.png) top left repeat}';
	style += '	.mask .mask_con{border-radius: 5px;position:absolute;top:50%;left:50%;width:454px;height:290px;margin-left:-227px;margin-top:-145px;background:#fff;}';
	style += '	.mask .mask_con .mask_title{border-radius: 5px 5px 0 0;width:100%;height:70px;padding:0 20px;background:#f1feff;overflow:hidden;}';
	style += '	.mask_title h1{float:left;line-height:70px;color: #3b475d;font-size:20px;}';
	style += '	.mask_title a{float:right;line-height:70px;color: #3b475d;font-size:20px;}';
	style += '	.mask .mask_con .mask_info{width:100%;text-align:center;}';
	style += '	.mask_info p{font-size:16px;color: #7d8697;margin-top:56px;}';
	style += '	.mask_info div{margin-left:37px;overflow:hidden;margin-top:35px;}';
	style += '	.mask_info div a{font-size:14px;display:block;float:left;width:110px;height:40px;text-align:center;margin:0 40px;background: url(../views/img/btn_ok.png) top left no-repeat; color: #fff;line-height:40px;}';
	style += '	.mask_info div a.cancel{background: url(../views/img/btn_no.png) top left no-repeat; color: #00afbf;}';
	style += '</style>';
	
	shtml += '<div class="mask" style="display: block;">';
	shtml += '	<div class="mask_con">';
	shtml += '		<div class="mask_title">';
	shtml += '			<h1>提示</h1>';
	shtml += '			<a href="javascript:;">X</a>';
	shtml += '		</div>';
	shtml += '		<div class="mask_info">';
	shtml += '			<p>' + tip + '</p>';
	shtml += '			<div>';
	shtml += '				<a href="javascript:;" id="mask_sure">确定</a>';
	shtml += '				<a href="javascript:;" class="cancel">取消</a>';
	shtml += '			</div>';
	shtml += '		</div>';
	shtml += '	</div>';
	shtml += '</div>';
	
	$('head').append(style);
	$('body').append(shtml);
	
	var mask = $('.mask');
	var colse = $('.mask_title a');
	var btnClose = $('.mask_info a.cancel');
	
	colse.click(function(){
		mask.hide();
		mask.remove();
	});
	btnClose.click(function(){
		mask.hide();
		mask.remove();
	});
	
	$('#mask_sure').click(function(){
		callback && callback();
		mask.hide();
		mask.remove();
	})
}